<?php
$v = $data['svalue'];
?><!doctype html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/public/diy/editor.css" />
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/js/validate.js?v=1.0"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/js/ajaxForm.js?v=1.0"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/admin/js/common.js?newversion"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/diy/diy_edit.js"></script>
    <!--upload-->
    <link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.css">
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.js"></script>
    <script type="text/javascript">
        upload_image_2("<?php echo site_url('admin/upload/ajax_upload');?>",'filePicker','title_logo','logo_box', '<?php echo URLPIC?>');
        var rowtypedata = [[
            [1, '&nbsp;'],
            [2,
            '<input style="width:80px;" placeholder="目的地" class="input" name="title[]" /> '+
            '<input style="width:100px" placeholder="链接地址" class="input" name="link[]" /> '+
            '<input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers[]" /> '+
            '<input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers_sec[]" /> '+
            '<br /><input style="width:150px" placeholder="图片链接地址" class="input" type="text" name="links[]" /> '+
            '<input id="pic_add_{n}" type="hidden" name="pic[]" value="" /><span id="pctrl_add_{n}">上传</span> ' +
            '<img id="box_add_{n}" class="view_pic"> ' +
            '<span style="display:inline-block;height:20px;"></span>' +
            '<a class="del" onclick="deleterow(this)"></a>'],
        ]];
        var add_init_upload_i = 0;
        function add_init_upload(){
            upload_image_2(
                "<?php echo site_url('admin/upload/ajax_upload');?>",
                "pctrl_add_"+add_init_upload_i,
                "pic_add_"+add_init_upload_i,
                "box_add_"+add_init_upload_i,
                "<?php echo URLPIC?>"
            );
            add_init_upload_i ++;
        }
    </script>
</head>
<body>
<div class="wrap">
    <div class="table_full divScroll" id="div_table" style="width: 100%;">
        <div class="h_a"><p>类型：多样式可切换线路列表 </p></div>
        <form method="post" class="formvalidate" action="<?php echo $form_url;?>" onsubmit="return false">
            <table class="list tab_label" cellpadding="0" cellspacing="1" border="0" id="general_config">
                <tbody>
                <tr>
                    <th style="width:100px">标题</th>
                    <td colspan="2"><input class="input rounded valid" type="text" name="name" value="<?php echo $v['name']?>" style="width:120px" /></td>
                </tr>
                <tr>
                    <th>线路列表</th>
                    <td colspan="2"></td>
                </tr>
                <tr>
                    <th></th>
                    <td colspan="2">
                        <input style="width:80px;" placeholder="目的地" class="input" name="title[]" value="<?php echo $v['title'][0]?>" />
                        <input style="width:100px" placeholder="链接地址" class="input" name="link[]" value="<?php echo $v['link'][0]?>">
                        <input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers[]" value="<?php echo $v['line_numbers'][0]?>" />
                        <input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers_sec[]" value="<?php echo $v['line_numbers_sec'][0]?>" />
                        <br />
                        <input type="hidden" id="pic_0" name="pic[]" value="<?php echo $v['pic'][0];?>" />
                        <input style="width:150px" placeholder="图片链接地址" class="input" type="text" name="links[]" value="<?php echo $v['links'][0]?>"  />
                        <span id="pctrl_0">上传</span> <img id="box_0" class="view_pic" id="box_0" data-uri="<?php echo $v['pic'][0];?>" src="<?php echo $v['pic'][0];?>"><span style="display:inline-block;height:20px;"></span>
                        <a class="del" onclick="deleterow(this)"></a>
                    </td>
                </tr>
                <?php
                foreach ((array)$v['title'] as $k => $vv) {
                    if($k ==0){
                        continue;
                    }
                ?>
                    <tr>
                        <th>&nbsp;</th>
                        <td colspan="2">
                            <input style="width:80px;" placeholder="目的地" class="input" name="title[]" value="<?php echo $v['title'][$k]?>" />
                            <input style="width:100px" placeholder="链接地址" class="input" name="link[]" value="<?php echo $v['link'][$k]?>">
                            <input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers[]" value="<?php echo $v['line_numbers'][$k]?>" />
                            <input style="width:220px" placeholder="多个线路编号用空格或逗号隔开" class="input" name="line_numbers_sec[]" value="<?php echo $v['line_numbers_sec'][$k]?>" />
                            <br />
                            <input type="hidden" id="pic_<?php echo $k?>" name="pic[]" value="<?php echo $v['pic'][$k]?>" />
                            <input style="width:150px" placeholder="图片链接地址" class="input" type="text" name="links[]" value="<?php echo $v['links'][$k]?>"  />
                            <span id="pctrl_<?php echo $k?>">上传</span>
                            <img class="view_pic" id="box_<?php echo $k?>" data-uri="<?php echo $v['pic'][$k];?>" src="<?php echo $v['pic'][$k];?>?>">
                            <span style="display:inline-block;height:20px;"></span>
                            <script type="text/javascript">
                                upload_image_2(
                                    "<?php echo site_url('admin/upload/ajax_upload');?>",
                                    'pctrl_<?php echo $k?>',
                                    'pic_<?php echo $k?>',
                                    'box_<?php echo $k?>',
                                    '<?php echo URLPIC?>'
                                );
                            </script>
                            <a class="del" onclick="deleterow(this)"></a>
                        </td>
                    </tr>
                <?php }?>
                <tr>
                    <th>&nbsp;</th>
                    <td colspan="2">
                        <a class="btn_submit" href="javascript:void(0);" onclick="addrow(this,0);add_init_upload();$('#div_table').css('height',diy_height);">增加</a>
                        <p class="ored">目的地填写行政区划名如：海南、云南、欧洲；多个线路编号用空格或逗号隔开。也可以填写个性的词语，如精选</p>
                        <p class="ored">链接地址填：目的地拼音；如hainan，yunnan，ouzohu</p>
                    </td>
                </tr>
                <tr>
                    <th>栏目图标</th>
                    <td style="vertical-align: middle;">
                        <input type="hidden" id="title_logo" name="title_logo" value="<?php echo $v['title_logo']?>" />
                        <span id="filePicker">上传</span>
                        <img class="view_pic" id="logo_box" data-uri="<?php echo $v['title_logo'] ? $v['title_logo'] : ''?>" src="<?php echo $v['title_logo'] ? $v['title_logo'] : ''?>">
                        <span style="display:inline-block;height:20px;"></span>
                    </td>
                    <td>
                        <span class="g">
                            <b class="ored">推荐尺寸200*30</b> 无法上传请等待加载完毕或重新打开页面；请使用<a class="ored" href="http://cloud.66diqiu.com/download/chrome.rar" target="_blank">Chrome浏览器</a>进行上传</span>
                    </td>
                </tr>
                <tr>
                    <th>&nbsp;</th>
                    <td colspan="2">
                        <button type="submit" class="btn_submit">保存</button>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    upload_image_2(
        "<?php echo site_url('admin/upload/ajax_upload');?>",
        'pctrl_0',
        'pic_0',
        'box_0',
        '<?php echo URLPIC?>'
    );
</script>
</body>
</html>